package cn.db101.jcc.service;

import cn.db101.jcc.entity.News;
import cn.db101.jcc.mapper.NewsMapper;
import com.mybatisflex.core.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author win
 * @description 针对表【t_news】的数据库操作Service实现
 * @createDate 2024-06-11 02:40:46
 */
@Service
public class NewsService {

    @Autowired
    private NewsMapper newsMapper;


    public List<News> newsList() {

        return newsMapper.selectListByQuery(QueryWrapper.create().orderBy(News::getCreateTime, false));
    }

}




